# Contributor: Aji Kisworo Mukti <aji.kisworo.mukti@gmail.com>
# Maintainer: Aji Kisworo Mukti <aji.kisworo.mukti@gmail.com>
pkgname=jpegoptim
pkgver=1.4.6
pkgrel=0
pkgdesc="JPEG optimization utility"
url="https://github.com/tjko/jpegoptim"
arch="all"
license="GPL-2.0-or-later"
depends=""
makedepends="libjpeg-turbo-dev"
options="!check"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tjko/jpegoptim/archive/RELEASE.$pkgver.tar.gz"
builddir="$srcdir/$pkgname-RELEASE.$pkgver"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--prefix=/usr \
		--mandir=/usr/share/man
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="1ed2408302d4f28a8019ab28f77e08c4de199d4c750cfd7b1a083908a5cca16c11dcdf6eab9e57ba935821db1e0a8398cea2d6f8e6ba5e07052690c0053d1b14  jpegoptim-1.4.6.tar.gz"
